from django.template import Template
from django.template.context import Context

class MetaObject(object):
    def __init__(self, meta_data):
        self.meta_data = meta_data
    
    def get_properties(self):
        """
        return a list of properties
        """
        return []

    def get_clazz(self):
        return Object

    def instantiate(self, scenario):
        return self.get_clazz()(self, scenario)

class Object(object):
    def __init__(self, meta_object, scenario):
        self.scenario = scenario
        self.data = {}
        context = Context({'scenario': scenario})
        for property in meta_object.get_properties():
            if property in meta_object.meta_data:
                self.data[property] = Template(meta_object.meta_data[property]).render(context)
            else:
                self.data[property] = None

    def as_text(self):
        """
        display the action as text
        """
        return None
    
    def as_html(self):
        """
        display the action as html
        """
        return None
